dojo.provide("widget.grid.cells.dijit");


dojo.require("dojox.grid.cells.dijit");
//dojo.require("dijit.form.DateTextBox");
//dojo.require("dijit.form.TimeTextBox");
//dojo.require("dijit.form.ComboBox");
//dojo.require("dojo.data.ItemFileReadStore");
//dojo.require("dijit.form.CheckBox");
//dojo.require("dijit.form.TextBox");
//dojo.require("dijit.form.NumberSpinner");
//dojo.require("dijit.form.NumberTextBox");
//dojo.require("dijit.form.CurrencyTextBox");
//dojo.require("dijit.form.HorizontalSlider");
//dojo.require("dijit.Editor");

(function(){
	dojo.declare("widget.grid.cells.CheckBox", dojox.grid.cells.CheckBox, {
		widgetClass: dijit.form.CheckBox,
		getValue: function(){
			return this.widget.checked?1:0;
		}
	});
	/*
	dojo.declare("dojox.grid.cells.Editor", dgc._Widget, {
		widgetClass: dijit.Editor,
		getWidgetProps: function(inDatum){
			return dojo.mixin({}, this.widgetProps||{}, {
				height: this.widgetHeight || "100px"
			});
		},
		createWidget: function(inNode, inDatum, inRowIndex){
			// widget needs its value set after creation
			var widget = new this.widgetClass(this.getWidgetProps(inDatum), inNode);
			dojo.connect(widget, 'onLoad', dojo.hitch(this, 'populateEditor'));
			return widget;
		},
		formatNode: function(inNode, inDatum, inRowIndex){
			this.content = inDatum;
			this.inherited(arguments);
			if(dojo.isMoz){
				// FIXME: seem to need to reopen the editor and display the toolbar
				var e = this.widget;
				e.open();
				if(this.widgetToolbar){
					dojo.place(e.toolbar.domNode, e.editingArea, "before");
				}
			}
		},
		populateEditor: function(){
			this.widget.attr('value', this.content);
			this.widget.placeCursorAtEnd();
		}
	});
	dgc.Editor.markupFactory = function(node, cell){
		dgc._Widget.markupFactory(node, cell);
		var d = dojo;
		var h = dojo.trim(dojo.attr(node, "widgetHeight")||"");
		if(h){
			if((h != "auto")&&(h.substr(-2) != "em")){
				h = parseInt(h, 10)+"px";
			}
			cell.widgetHeight = h;
		}
	};
	*/
})();
